import moment from 'moment'

export function getCurrentDate() {
  return moment(new Date()).format("YYYY-MM-DD")
}

export function formatDate(date, format) {
  return moment(date).format(format)
}

export function dateDiff(start, end) {
  let start_date = moment(start)
  let end_date = moment(end)
  const diff_days = end_date.diff(start_date, "days") + 1
  return diff_days
}
// var diff_days = leave_time.diff(enter_time,"days") + 1;
// console.log(diff_days);
// if(!isNaN(diff_days)){
//     $("#id_hospital_day").val(diff_days);
// }